<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%files}}".
 *
 * @property int $id
 * @property string $fs_component_id
 * @property string $filename
 * @property int $type 1图片2视频99其他
 * @property string $locate_path 定位路径
 * @property int $created_at
 */
class Files extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%files}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['fs_component_id', 'filename', 'type', 'locate_path', 'created_at'], 'trim'],
            [['fs_component_id', 'filename', 'locate_path', 'created_at'], 'required'],
            [['type', 'created_at'], 'integer'],
            [['fs_component_id'], 'string', 'max' => 60],
            [['filename', 'locate_path'], 'string', 'max' => 180],
            [['type'], 'default', 'value' => 1],
            [['filename'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'fs_component_id' => Yii::t('app', 'Fs Component ID'),
            'filename' => Yii::t('app', 'Filename'),
            'type' => Yii::t('app', '1图片2视频99其他'),
            'locate_path' => Yii::t('app', '定位路径'),
            'created_at' => Yii::t('app', 'Created At'),
        ];
    }
}
